package com.wish.g04.financing.controller;

import com.wish.g04.base.entity.CwClearing;
import com.wish.g04.common.core.web.domain.AjaxResult;
import com.wish.g04.financing.service.ClearingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 结算管理
 * @author tianyandong
 */
@RestController
@RequestMapping("/clearing")
public class ClearingController {

    @Autowired
    private ClearingService clearingService;


    /**
     * 查询所有结算信息
     * @param cwClearing
     * @return
     */
    @GetMapping("getClearingList")
    public AjaxResult getClearingList(CwClearing cwClearing) {
        List<CwClearing> clearingList = clearingService.getClearingList(cwClearing);
        return AjaxResult.success(clearingList);
    }


    /**
     * 确认结算
     * @param ids
     * @return
     */
    @PostMapping("notarizeClearing")
    public AjaxResult notarizeClearing(@RequestBody List<Integer> ids) {
        return AjaxResult.success(clearingService.notarizeClearing(ids));
    }
}
